push_cancel_local_notification


描述

这个函数将会取消已有的推送通知。You can get the ID for the notification to cancel using the functions push_get_first_local_notification() and push_get_next_local_notification() and the function will return true on success or false otherwise (for example if the notification does not exist or has already been triggered).

注意: This function is limited to the iOS and Android target modules.


语法:

push_cancel_local_notification(ID);

参数 描述
ID 被取消的通知的 ID 。


返回:

Real(实数)


例子:

var map = ds_map_create();
var ntf = push_get_first_local_notification(map);
while(ntf >= 0)
   {
   var data = ds_map_find_value(map, "data");
   if data == "Daily_Reward"
      {
      push_cancel_local_notification(ntf);
      }
   ntf = push_get_next_local_notification(map);
   }
ds_map_destroy(map);

上面的代码创建了一个 ds_map ,然后请求数据队列中第一个可用的通知。如果通知存在, map 将被赋值,通过代码查找key为 "data"的特定字符串。如果找到该字符串,则通知取消,继续检查队列中的下一个通知,直到所有通知都被检查。